import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import render from '@dfeidao/atom-web/render/render';
import p001 from './p001';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import Paging from '@dfeidao/fd-w000010';
import get from '@dfeidao/atom-web/local/get';

export default async function a006(fd: IFeidaoAiBrowserComponent, e: { page_no: number }) {
	// 分页
	const page_no = e.page_no;
	const d_name = get(fd, 'd_name');
	const d_level = get(fd, 'd_level');
	const nos = get(fd, 'nos');
	const res = await nodejs('risk-point/zj-000005/s001', {
		filter: {
			page_no: page_no,
			risk_po_type_name: d_name,
			risk_level: d_level,

			risk_po_type_no: nos,
			risk_po_name_no: '',
			risk_po_name: ''
		}
	});
	console.log(res);
	const render_data = get(fd, 'render_data');
	const render_data1 = Object.assign(res, { d_name });
	console.log(render_data1, 'render');
	render(fd, render_data1, p001, 'p001', 'inner');

	//点击页码数时页码随之改变
	const p = fd.data.node.querySelector<Paging>('[data-id="paging"]')
	p.setAttribute('page-no', page_no + '');
}
